package de.koller.nadir.input;

import de.koller.nadir.NNode;
import de.koller.oceanFramework.gl.util.InputGL;
import de.koller.oceanFramework.tree.Child;
import org.lwjgl.input.Keyboard;

public class NInput extends NNode {
	@Child private final InputGL input = new InputGL();
		
	@Override
	protected void update( int elapsedTime ) {
		super.update( elapsedTime );
		
		if( input.isKeyPressed( Keyboard.KEY_F12 ) )
			nroot.stop();	
		
		cameraSteering();
	}
	
	private void cameraSteering() {
		if( input.isMouseDown( 1 ) ) {
			nroot.render.camera.moveCamera( input.getMouseDX(), input.getMouseDY() );
		}
	}
	
}
